﻿using BP.En;

namespace BP.Sys
{
	/// <summary>
	/// 数据权限
	/// </summary>
    public class DBSafe : EntityMyPK
    {
        #region 构造方法
        /// <summary>
        /// 数据权限
        /// </summary>
        public DBSafe()
        {
        }
        /// <summary>
        /// 重写基类方法
        /// </summary>
        public override Map EnMap
        {
            get
            {
                if (this._enMap != null)
                    return this._enMap;

                Map map = new Map("Frm_DBRole", "数据权限");
                map.AddMyPK();

                map.AddTBString("TableName", null, "TableName", false, false, 0, 300, 10);
                map.AddTBString("TableDesc", null, "TableDesc", false, false, 0, 300, 10);

                //DBList=记录查询权限, RecReadonly=记录只读权限, RedDelete记录删除权限.
                map.AddTBString("DBRole", null, "规则", false, false, 0, 300, 10);

                map.AddTBString("MarkID", null, "权限标记", true, true, 0, 50, 100, true);
                map.AddTBString("MarkName", null, "权限标记", true, true, 0, 50, 120, true);
                map.AddTBString("Docs", null, "控制内容", true, true, 0, 4000, 120, true);
                map.AddTBInt("Idx", 0, "Idx", true, true);

                this._enMap = map;
                return this._enMap;
            }
        }
        #endregion
    }
    /// <summary>
    /// 数据权限
    /// </summary>
    public class DBSafes : EntitiesMyPK
    {
        /// <summary>
        /// 数据权限
        /// </summary>
        public DBSafes() { }
        /// <summary>
        /// 得到它的 Entity 
        /// </summary>
        public override Entity GetNewEntity
        {
            get
            {
                return new DBSafe();
            }
        }

        #region 为了适应自动翻译成java的需要,把实体转换成List.
        /// <summary>
        /// 转化成 java list,C#不能调用.
        /// </summary>
        /// <returns>List</returns>
        public System.Collections.Generic.IList<DBSafe> ToJavaList()
        {
            return (System.Collections.Generic.IList<DBSafe>)this;
        }
        /// <summary>
        /// 转化成list
        /// </summary>
        /// <returns>List</returns>
        public System.Collections.Generic.List<DBSafe> Tolist()
        {
            System.Collections.Generic.List<DBSafe> list = new System.Collections.Generic.List<DBSafe>();
            for (int i = 0; i < this.Count; i++)
            {
                list.Add((DBSafe)this[i]);
            }
            return list;
        }
        #endregion 为了适应自动翻译成java的需要,把实体转换成List.
    }
}
